Optimal. Leaf size=85 \[ -\frac {A}{2 a^2 x^2}+\frac {2 A b-a B}{a^3 x}+\frac {b (A b-a B)}{a^3 (a+b x)}+\frac {b (3 A b-2 a B) \log (x)}{a^4}-\frac {b (3 A b-2 a B) \log (a+b x)}{a^4} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 85, normalized size of antiderivative = 1.00, number of steps
used = 2, number of rules used = 1, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.062, Rules used = {78}
\begin {gather*} \frac {b \log (x) (3 A b-2 a B)}{a^4}-\frac {b (3 A b-2 a B) \log (a+b x)}{a^4}+\frac {2 A b-a B}{a^3 x}+\frac {b (A b-a B)}{a^3 (a+b x)}-\frac {A}{2 a^2 x^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 78
Rubi steps
\begin {align*} \int \frac {A+B x}{x^3 (a+b x)^2} \, dx &=\int \left (\frac {A}{a^2 x^3}+\frac {-2 A b+a B}{a^3 x^2}-\frac {b (-3 A b+2 a B)}{a^4 x}+\frac {b^2 (-A b+a B)}{a^3 (a+b x)^2}+\frac {b^2 (-3 A b+2 a B)}{a^4 (a+b x)}\right ) \, dx\\ &=-\frac {A}{2 a^2 x^2}+\frac {2 A b-a B}{a^3 x}+\frac {b (A b-a B)}{a^3 (a+b x)}+\frac {b (3 A b-2 a B) \log (x)}{a^4}-\frac {b (3 A b-2 a B) \log (a+b x)}{a^4}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.05, size = 85, normalized size = 1.00 \begin {gather*} \frac {-\frac {a \left (-6 A b^2 x^2+a^2 (A+2 B x)+a b x (-3 A+4 B x)\right )}{x^2 (a+b x)}+2 b (3 A b-2 a B) \log (x)+2 b (-3 A b+2 a B) \log (a+b x)}{2 a^4} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.07, size = 84, normalized size = 0.99
method | result | size |
default | \(-\frac {b \left (3 A b -2 B a \right ) \ln \left (b x +a \right )}{a^{4}}+\frac {b \left (A b -B a \right )}{a^{3} \left (b x +a \right )}-\frac {A}{2 a^{2} x^{2}}-\frac {-2 A b +B a}{a^{3} x}+\frac {b \left (3 A b -2 B a \right ) \ln \left (x \right )}{a^{4}}\) | \(84\) |
norman | \(\frac {-\frac {A}{2 a}+\frac {\left (3 A b -2 B a \right ) x}{2 a^{2}}-\frac {b \left (3 b^{2} A -2 a b B \right ) x^{3}}{a^{4}}}{x^{2} \left (b x +a \right )}+\frac {b \left (3 A b -2 B a \right ) \ln \left (x \right )}{a^{4}}-\frac {b \left (3 A b -2 B a \right ) \ln \left (b x +a \right )}{a^{4}}\) | \(93\) |
risch | \(\frac {\frac {b \left (3 A b -2 B a \right ) x^{2}}{a^{3}}+\frac {\left (3 A b -2 B a \right ) x}{2 a^{2}}-\frac {A}{2 a}}{x^{2} \left (b x +a \right )}+\frac {3 b^{2} \ln \left (-x \right ) A}{a^{4}}-\frac {2 b \ln \left (-x \right ) B}{a^{3}}-\frac {3 b^{2} \ln \left (b x +a \right ) A}{a^{4}}+\frac {2 b \ln \left (b x +a \right ) B}{a^{3}}\) | \(104\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 99, normalized size = 1.16 \begin {gather*} -\frac {A a^{2} + 2 \, {\left (2 \, B a b - 3 \, A b^{2}\right )} x^{2} + {\left (2 \, B a^{2} - 3 \, A a b\right )} x}{2 \, {\left (a^{3} b x^{3} + a^{4} x^{2}\right )}} + \frac {{\left (2 \, B a b - 3 \, A b^{2}\right )} \log \left (b x + a\right )}{a^{4}} - \frac {{\left (2 \, B a b - 3 \, A b^{2}\right )} \log \left (x\right )}{a^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 1.47, size = 150, normalized size = 1.76 \begin {gather*} -\frac {A a^{3} + 2 \, {\left (2 \, B a^{2} b - 3 \, A a b^{2}\right )} x^{2} + {\left (2 \, B a^{3} - 3 \, A a^{2} b\right )} x - 2 \, {\left ({\left (2 \, B a b^{2} - 3 \, A b^{3}\right )} x^{3} + {\left (2 \, B a^{2} b - 3 \, A a b^{2}\right )} x^{2}\right )} \log \left (b x + a\right ) + 2 \, {\left ({\left (2 \, B a b^{2} - 3 \, A b^{3}\right )} x^{3} + {\left (2 \, B a^{2} b - 3 \, A a b^{2}\right )} x^{2}\right )} \log \left (x\right )}{2 \, {\left (a^{4} b x^{3} + a^{5} x^{2}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 184 vs.
\(2 (80) = 160\).
time = 0.30, size = 184, normalized size = 2.16 \begin {gather*} \frac {- A a^{2} + x^{2} \cdot \left (6 A b^{2} - 4 B a b\right ) + x \left (3 A a b - 2 B a^{2}\right )}{2 a^{4} x^{2} + 2 a^{3} b x^{3}} - \frac {b \left (- 3 A b + 2 B a\right ) \log {\left (x + \frac {- 3 A a b^{2} + 2 B a^{2} b - a b \left (- 3 A b + 2 B a\right )}{- 6 A b^{3} + 4 B a b^{2}} \right )}}{a^{4}} + \frac {b \left (- 3 A b + 2 B a\right ) \log {\left (x + \frac {- 3 A a b^{2} + 2 B a^{2} b + a b \left (- 3 A b + 2 B a\right )}{- 6 A b^{3} + 4 B a b^{2}} \right )}}{a^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 1.51, size = 130, normalized size = 1.53 \begin {gather*} -\frac {{\left (2 \, B a b^{2} - 3 \, A b^{3}\right )} \log \left ({\left | -\frac {a}{b x + a} + 1 \right |}\right )}{a^{4} b} - \frac {\frac {B a b^{4}}{b x + a} - \frac {A b^{5}}{b x + a}}{a^{3} b^{3}} - \frac {2 \, B a b - 5 \, A b^{2} - \frac {2 \, {\left (B a^{2} b^{2} - 3 \, A a b^{3}\right )}}{{\left (b x + a\right )} b}}{2 \, a^{4} {\left (\frac {a}{b x + a} - 1\right )}^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.10, size = 104, normalized size = 1.22 \begin {gather*} \frac {\frac {x\,\left (3\,A\,b-2\,B\,a\right )}{2\,a^2}-\frac {A}{2\,a}+\frac {b\,x^2\,\left (3\,A\,b-2\,B\,a\right )}{a^3}}{b\,x^3+a\,x^2}-\frac {2\,b\,\mathrm {atanh}\left (\frac {b\,\left (3\,A\,b-2\,B\,a\right )\,\left (a+2\,b\,x\right )}{a\,\left (3\,A\,b^2-2\,B\,a\,b\right )}\right )\,\left (3\,A\,b-2\,B\,a\right )}{a^4} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________